
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.ApusicPackage;
import Apusic.JMSQueue;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>JMS Queue</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.JMSQueueImpl#getName <em>Name</em>}</li>
 *   <li>{@link Apusic.impl.JMSQueueImpl#getDescription <em>Description</em>}</li>
 *   <li>{@link Apusic.impl.JMSQueueImpl#getJndiName <em>Jndi Name</em>}</li>
 *   <li>{@link Apusic.impl.JMSQueueImpl#getCacheSize <em>Cache Size</em>}</li>
 *   <li>{@link Apusic.impl.JMSQueueImpl#getExpiryCheckInterval <em>Expiry Check Interval</em>}</li>
 *   <li>{@link Apusic.impl.JMSQueueImpl#getStateString <em>State String</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class JMSQueueImpl extends WrappingEObjectImpl implements JMSQueue
{
  /**
   * The default value of the '{@link #getName() <em>Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getName()
   * @generated
   * @ordered
   */
  protected static final String NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getName()
   * @generated
   * @ordered
   */
  protected String name = NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDescription()
   * @generated
   * @ordered
   */
  protected static final String DESCRIPTION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDescription()
   * @generated
   * @ordered
   */
  protected String description = DESCRIPTION_EDEFAULT;

  /**
   * The default value of the '{@link #getJndiName() <em>Jndi Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiName()
   * @generated
   * @ordered
   */
  protected static final String JNDI_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getJndiName() <em>Jndi Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getJndiName()
   * @generated
   * @ordered
   */
  protected String jndiName = JNDI_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getCacheSize() <em>Cache Size</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCacheSize()
   * @generated
   * @ordered
   */
  protected static final int CACHE_SIZE_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getCacheSize() <em>Cache Size</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCacheSize()
   * @generated
   * @ordered
   */
  protected int cacheSize = CACHE_SIZE_EDEFAULT;

  /**
   * The default value of the '{@link #getExpiryCheckInterval() <em>Expiry Check Interval</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getExpiryCheckInterval()
   * @generated
   * @ordered
   */
  protected static final int EXPIRY_CHECK_INTERVAL_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getExpiryCheckInterval() <em>Expiry Check Interval</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getExpiryCheckInterval()
   * @generated
   * @ordered
   */
  protected int expiryCheckInterval = EXPIRY_CHECK_INTERVAL_EDEFAULT;

  /**
   * The default value of the '{@link #getStateString() <em>State String</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getStateString()
   * @generated
   * @ordered
   */
  protected static final String STATE_STRING_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getStateString() <em>State String</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getStateString()
   * @generated
   * @ordered
   */
  protected String stateString = STATE_STRING_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected JMSQueueImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.JMS_QUEUE;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    if(core!=null && ((JMSConfig)core).getName().equals(((JMSConfig)arg0).getName()))
  result=true;
else
  result=false;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    JMSConfig core=(JMSConfig)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  
  
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
  
  
  
  
  
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getName()
  {
        Object result=null;
        JMSConfig core=(JMSConfig)getCore();
        if(core==null) return name;	
        try
{
name=core.getName();
}
catch(Exception e)
{
  name = null;
}
    return name; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setName(String newName)
  {
    String oldName = name;
    name = newName;
        	
      JMSConfig core=(JMSConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JMS_QUEUE__NAME, oldName, name));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getDescription()
  {
        Object result=null;
        JMSConfig core=(JMSConfig)getCore();
        if(core==null) return description;	
        try
{
description=core.getDescription();
}
catch(Exception e)
{
  description = null;
}
    return description; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDescription(String newDescription)
  {
    String oldDescription = description;
    description = newDescription;
        	
      JMSConfig core=(JMSConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JMS_QUEUE__DESCRIPTION, oldDescription, description));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getJndiName()
  {
        Object result=null;
        JMSConfig core=(JMSConfig)getCore();
        if(core==null) return jndiName;	
        try
{
jndiName=core.getJndiName();
}
catch(Exception e)
{
  jndiName = null;
}
    return jndiName; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setJndiName(String newJndiName)
  {
    String oldJndiName = jndiName;
    jndiName = newJndiName;
        	
      JMSConfig core=(JMSConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JMS_QUEUE__JNDI_NAME, oldJndiName, jndiName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getCacheSize()
  {
        Object result=null;
        JMSConfig core=(JMSConfig)getCore();
        if(core==null) return cacheSize;	
        try
{
cacheSize=core.getCacheSize();
}
catch(Exception e)
{
  cacheSize = -1;
}
    return cacheSize; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCacheSize(int newCacheSize)
  {
    int oldCacheSize = cacheSize;
    cacheSize = newCacheSize;
        	
      JMSConfig core=(JMSConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JMS_QUEUE__CACHE_SIZE, oldCacheSize, cacheSize));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getExpiryCheckInterval()
  {
        Object result=null;
        JMSConfig core=(JMSConfig)getCore();
        if(core==null) return expiryCheckInterval;	
        try
{
expiryCheckInterval=core.getExpiryCheckInterval();
}
catch(Exception e)
{
  expiryCheckInterval = -1;
}
    return expiryCheckInterval; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setExpiryCheckInterval(int newExpiryCheckInterval)
  {
    int oldExpiryCheckInterval = expiryCheckInterval;
    expiryCheckInterval = newExpiryCheckInterval;
        	
      JMSConfig core=(JMSConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JMS_QUEUE__EXPIRY_CHECK_INTERVAL, oldExpiryCheckInterval, expiryCheckInterval));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getStateString()
  {
        Object result=null;
        JMSConfig core=(JMSConfig)getCore();
        if(core==null) return stateString;	
        try
{
stateString=core.getStateString();
}
catch(Exception e)
{
  stateString = null;
}
    return stateString; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setStateString(String newStateString)
  {
    String oldStateString = stateString;
    stateString = newStateString;
        	
      JMSConfig core=(JMSConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JMS_QUEUE__STATE_STRING, oldStateString, stateString));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.JMS_QUEUE__NAME:
        return getName();
      case ApusicPackage.JMS_QUEUE__DESCRIPTION:
        return getDescription();
      case ApusicPackage.JMS_QUEUE__JNDI_NAME:
        return getJndiName();
      case ApusicPackage.JMS_QUEUE__CACHE_SIZE:
        return new Integer(getCacheSize());
      case ApusicPackage.JMS_QUEUE__EXPIRY_CHECK_INTERVAL:
        return new Integer(getExpiryCheckInterval());
      case ApusicPackage.JMS_QUEUE__STATE_STRING:
        return getStateString();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.JMS_QUEUE__NAME:
        setName((String)newValue);
        return;
      case ApusicPackage.JMS_QUEUE__DESCRIPTION:
        setDescription((String)newValue);
        return;
      case ApusicPackage.JMS_QUEUE__JNDI_NAME:
        setJndiName((String)newValue);
        return;
      case ApusicPackage.JMS_QUEUE__CACHE_SIZE:
        setCacheSize(((Integer)newValue).intValue());
        return;
      case ApusicPackage.JMS_QUEUE__EXPIRY_CHECK_INTERVAL:
        setExpiryCheckInterval(((Integer)newValue).intValue());
        return;
      case ApusicPackage.JMS_QUEUE__STATE_STRING:
        setStateString((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.JMS_QUEUE__NAME:
        setName(NAME_EDEFAULT);
        return;
      case ApusicPackage.JMS_QUEUE__DESCRIPTION:
        setDescription(DESCRIPTION_EDEFAULT);
        return;
      case ApusicPackage.JMS_QUEUE__JNDI_NAME:
        setJndiName(JNDI_NAME_EDEFAULT);
        return;
      case ApusicPackage.JMS_QUEUE__CACHE_SIZE:
        setCacheSize(CACHE_SIZE_EDEFAULT);
        return;
      case ApusicPackage.JMS_QUEUE__EXPIRY_CHECK_INTERVAL:
        setExpiryCheckInterval(EXPIRY_CHECK_INTERVAL_EDEFAULT);
        return;
      case ApusicPackage.JMS_QUEUE__STATE_STRING:
        setStateString(STATE_STRING_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.JMS_QUEUE__NAME:
        return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
      case ApusicPackage.JMS_QUEUE__DESCRIPTION:
        return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
      case ApusicPackage.JMS_QUEUE__JNDI_NAME:
        return JNDI_NAME_EDEFAULT == null ? jndiName != null : !JNDI_NAME_EDEFAULT.equals(jndiName);
      case ApusicPackage.JMS_QUEUE__CACHE_SIZE:
        return cacheSize != CACHE_SIZE_EDEFAULT;
      case ApusicPackage.JMS_QUEUE__EXPIRY_CHECK_INTERVAL:
        return expiryCheckInterval != EXPIRY_CHECK_INTERVAL_EDEFAULT;
      case ApusicPackage.JMS_QUEUE__STATE_STRING:
        return STATE_STRING_EDEFAULT == null ? stateString != null : !STATE_STRING_EDEFAULT.equals(stateString);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (name: ");
    result.append(name);
    result.append(", description: ");
    result.append(description);
    result.append(", jndiName: ");
    result.append(jndiName);
    result.append(", cacheSize: ");
    result.append(cacheSize);
    result.append(", expiryCheckInterval: ");
    result.append(expiryCheckInterval);
    result.append(", stateString: ");
    result.append(stateString);
    result.append(')');
    return result.toString();
  }

} //JMSQueueImpl
